TOP=../..

include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS BELOW HERE

# xxxRecord.h will be created from xxxRecord.dbd
DBDINC += xxxRecord

# Install xxxSupport.dbd into <top>/dbd
DBD += xxxSupport.dbd

# Build an IOC support library
LIBRARY_IOC += myiocSupport

# Compile and add the code to the support library
myiocSupport_SRCS += xxxRecord.c
myiocSupport_SRCS += devXxxSoft.c

# Link locally-provided code into the support library,
# rather than directly into the IOC application.
# This is required for Windows DLL builds.
myiocSupport_SRCS += dbSubExample.c
myiocSupport_SRCS += myiocHello.c
myiocSupport_SRCS += initTrace.c

myiocSupport_LIBS += $(EPICS_BASE_IOC_LIBS)


# Build the IOC application
PROD_IOC = myioc

# myioc.dbd will be created and installed
DBD += myioc.dbd

# myioc.dbd will include these files:
myioc_DBD += base.dbd
myioc_DBD += xxxSupport.dbd
myioc_DBD += dbSubExample.dbd
myioc_DBD += myiocHello.dbd
myioc_DBD += initTrace.dbd

myioc_DBD += asyn.dbd
myioc_DBD += stream.dbd
myioc_DBD += xxxAppInclude.dbd


# myioc_registerRecordDeviceDriver.cpp derives from myioc.dbd
myioc_SRCS += myioc_registerRecordDeviceDriver.cpp

# Build the main IOC entry point where needed
myioc_SRCS_DEFAULT += myiocMain.cpp
myioc_SRCS_vxWorks += -nil-

# Link in the code from our support library
myioc_LIBS += myiocSupport

myioc_LIBS += asyn
myioc_LIBS += stream


# To build SNL programs, SNCSEQ must be defined
# in the <top>/configure/RELEASE file
ifneq ($(SNCSEQ),)
    # Build sncExample into myiocSupport
    sncExample_SNCFLAGS += +r
    myioc_DBD += sncExample.dbd
    # A .stt sequence program is *not* pre-processed:
    myiocSupport_SRCS += sncExample.stt
    myiocSupport_LIBS += seq pv
    myioc_LIBS += seq pv

    # Build sncProgram as a standalone program
    PROD_HOST += sncProgram
    sncProgram_SNCFLAGS += +m
    # A .st sequence program *is* pre-processed:
    sncProgram_SRCS += sncProgram.st
    sncProgram_LIBS += seq pv
    sncProgram_LIBS += $(EPICS_BASE_HOST_LIBS)
endif

# Finally link IOC to the EPICS Base libraries
myioc_LIBS += $(EPICS_BASE_IOC_LIBS)

include $(TOP)/configure/RULES
#----------------------------------------
#  ADD EXTRA GNUMAKE RULES BELOW HERE

